package teacher.action;

import teacher.bean.Patent;
import teacher.service.flow;
import teacher.service.patent;

import com.opensymphony.xwork2.ActionSupport;

public class deletePat extends ActionSupport {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private int patentid;
	String suc;

	public String getSuc() {
		return suc;
	}

	public void setSuc(String suc) {
		this.suc = suc;
	}

	public int getPatentid() {
		return patentid;
	}

	public void setPatentid(int patentid) {
		this.patentid = patentid;
	}

	public String execute() throws Exception {
		
		Patent pat=new Patent();
		pat.setPatId(patentid);
		if(new flow().DeleteFlow(patentid, 0))//删除流程
		{System.out.println("删除流程成功！！！");}
		if(new patent().DeletePatent(pat))
		{
			this.setSuc("success");
		return SUCCESS;}
		else{
			return ERROR;
		}
	}


	
}
